package com.AuthServer.convertor;

import org.springframework.stereotype.Component;

@Component
public class WhetherConverter {

    public Integer convertToJavaData(String value) {
        return switch (value) {
            case "禁用" -> 0;
            case "启用" -> 1;
            default -> null;
        };
    }

    public String convertToExcelData(Integer value) {
        return switch (value) {
            case 0 -> "禁用";
            case 1 -> "启用";
            default -> null;
        };
    }
}
